package at.ac.tuwien.ifs.calendit.basis.gui;

import java.awt.BorderLayout;
import java.awt.Color;

import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;

public class Verwaltung extends JPanel{

	/**
	 * 
	 */
	private static final long serialVersionUID = -6977296954733093974L;
	private JPanel east_panel;
	private JPanel south_panel;
	private JPanel west_panel;
	private JPanel north_panel;
	//private JPanel main_panel;
	private BorderLayout layout;
	private JTabbedPane tabbed_pane;
	public Verwaltung(){
		super();
		initGUI();
	}

	private void initGUI() {
		layout = new BorderLayout();
		this.setPreferredSize(new java.awt.Dimension(1013, 483));
		this.setBackground(Color.white);
		this.setBorder(BorderFactory.createLineBorder(Color.orange));
		this.setLayout(layout);
		this.add(getEast(), BorderLayout.EAST);
		this.add(getWest(), BorderLayout.WEST);
		this.add(getSouth(), BorderLayout.SOUTH);
		this.add(getNorth(), BorderLayout.NORTH);
		this.add(getCenter(), BorderLayout.CENTER);
	}
	
	private JTabbedPane getCenter() {
		if(tabbed_pane == null){
			//main_panel = new JPanel();
			//main_panel.setBackground(Color.gray);
			//main_panel.setPreferredSize(new java.awt.Dimension(500, 20));
			tabbed_pane = new JTabbedPane();
			//scroll_pane = new JScrollPane();
			//main_panel.add(tabbed_pane);
			//scroll_pane.setViewportView(tabbed_pane);
			tabbed_pane.setPreferredSize(new java.awt.Dimension(950, 700));
			tabbed_pane.addTab("Benutzerverwaltung", null, new BenutzerVerwaltungMainFrame(), null);
			tabbed_pane.addTab("Raumverwaltung", null, new Raumverwaltung(), null);
			tabbed_pane.addTab("Abteilungsverwaltung", null, new Abteilungsverwaltung(), null);
			
		}
		return tabbed_pane;
	}

	private JPanel getNorth() {
		if(north_panel == null) {
			north_panel = new JPanel();
			north_panel.setBackground(Color.white);
			north_panel.setPreferredSize(new java.awt.Dimension(500, 20));
    	}
    	return north_panel;
	}

	private JPanel getEast() {
    	if(east_panel == null) {
    		east_panel = new JPanel();
    		east_panel.setBackground(Color.white);
    		east_panel.setPreferredSize(new java.awt.Dimension(20, 400));
    	}
    	return east_panel;
    }
	
    private JPanel getWest() {
    	if(west_panel == null) {
    		west_panel = new JPanel();
    		west_panel.setBackground(Color.white);
    		west_panel.setPreferredSize(new java.awt.Dimension(20, 400));
    	}
    	return west_panel;
    }
    
    private JPanel getSouth() {
		if(south_panel == null) {
    		south_panel = new JPanel();
    		south_panel.setBackground(Color.white);
    		south_panel.setPreferredSize(new java.awt.Dimension(500, 20));
    	}
    	return south_panel;
    }
}
